package com.zyz.H_比较器;

import java.util.Arrays;

/**
 * @author: vick
 * @Date: 2025/3/19
 * @Description:
 * @version: 1.0
 */
public class Demo1 {
    public static void main(String[] args) {
        String[] arr = {"AA", "BB", "CC", "KK", "MM", "GG"};
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));

        String str1 =  "AA";
        String str2 = "BB";
        int i = str1.compareTo(str2);
        if (i == 0) {
            System.out.println("相等");
        }else if (i < 0){
            System.out.println("str1 < str2");
        }else {
            System.out.println("str1 > str2");
        }
    }
}
